﻿@using Model.Task;
@{
    Layout = null;
    var list = ViewData["list"] as List<ScheduleJobModel>;
}

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- header page -->
    @IncludeView("header")
</head>

<body>
    @Html.Partial(IncludePath("body_top"))
    @Html.Partial(IncludePath("manage_nav"))

    <div class="container-fluid">

        <div class="row">
            <div class="col-md-12">
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <td>名称</td>
                            <td>开始时间</td>
                            <td>上次执行</td>
                            <td>下次执行</td>
                            <td>状态</td>
                            <td>是否运行</td>
                        </tr>
                    </thead>
                    <tbody>
                        @if (ValidateHelper.IsPlumpList(list))
                        {
                            foreach (var model in list)
                            {
                                <tr>
                                    <td>@(model.JobName)</td>
                                    <td>@(DateTimeHelper.GetFriendlyDateTime(model.StartTime))</td>
                                    <td>@(DateTimeHelper.GetFriendlyDateTime(model.PreTriggerTime ?? DateTime.Now))</td>
                                    <td>@(DateTimeHelper.GetFriendlyDateTime(model.NextTriggerTime ?? DateTime.Now))</td>
                                    <td>@(model.JobStatus)</td>
                                    <td>@(model.IsRunning ? "是" : "否")</td>
                                </tr>
                            }
                        }
                    </tbody>
                </table>

            </div>
        </div>
    </div>
    @Html.Partial(IncludePath("body_bottom"))
</body>
</html>
